﻿using DAL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BLL
{
    public class BookDAL
    {
        SqlCommand cmd; //定义Command对象
        DataSet ds;//定义数据集对象
        public BookDAL()
        {
            cmd = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure; //定义DB访问类型为存储过程
            ds = new DataSet();
        }
        public DataSet GetBookList()
        {
            cmd.CommandText = "GetBooks";
            cmd.Parameters.Clear(); //清除传参内容
            ds = DBhelper.QueryData(cmd); //调用通用数据访问类实现DataSet读取
            return ds;
        }
    }
}
